home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / gcc / ixemsdk.lha / man / cat3 / strtoul.0 < prev    next >
Text File  |  1996-09-02  |  3KB  |  67 lines

  1.  
  2. STRTOUL(3)                 UNIX Programmer's Manual                 STRTOUL(3)
  3.  
  4. NNAAMMEE
  5.      ssttrrttoouull,, ssttrrttoouuqq - convert a string to an unsigned long or uquad_t
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssttddlliibb..hh>>
  9.      ##iinncclluuddee <<lliimmiittss..hh>>
  10.  
  11.      _u_n_s_i_g_n_e_d _l_o_n_g
  12.      ssttrrttoouull(_c_o_n_s_t _c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e)
  13.  
  14.  
  15.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  16.      ##iinncclluuddee <<ssttddlliibb..hh>>
  17.      ##iinncclluuddee <<lliimmiittss..hh>>
  18.  
  19.      _u___q_u_a_d___t
  20.      ssttrrttoouuqq(_c_o_n_s_t _c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e)
  21.  
  22. DDEESSCCRRIIPPTTIIOONN
  23.      The ssttrrttoouull() function converts the string in _n_p_t_r to an _u_n_s_i_g_n_e_d _l_o_n_g
  24.      value.  The ssttrrttoouuqq() function converts the string in _n_p_t_r to a _u___q_u_a_d___t
  25.      value.  The conversion is done according to the given _b_a_s_e, which must be
  26.      between 2 and 36 inclusive, or be the special value 0.
  27.  
  28.      The string may begin with an arbitrary amount of white space (as deter-
  29.      mined by isspace(3))  followed by a single optional `+' or `-' sign.  If
  30.      _b_a_s_e is zero or 16, the string may then include a `0x' prefix, and the
  31.      number will be read in base 16; otherwise, a zero _b_a_s_e is taken as 10
  32.      (decimal) unless the next character is `0', in which case it is taken as
  33.      8 (octal).
  34.  
  35.      The remainder of the string is converted to an _u_n_s_i_g_n_e_d _l_o_n_g value in the
  36.      obvious manner, stopping at the end of the string or at the first charac-
  37.      ter that does not produce a valid digit in the given base.  (In bases
  38.      above 10, the letter `A' in either upper or lower case represents 10, `B'
  39.      represents 11, and so forth, with `Z' representing 35.)
  40.  
  41.      If _e_n_d_p_t_r is non nil, ssttrrttoouull() stores the address of the first invalid
  42.      character in _*_e_n_d_p_t_r. If there were no digits at all, however, ssttrrttoouull()
  43.      stores the original value of _n_p_t_r in _*_e_n_d_p_t_r. (Thus, if _*_n_p_t_r is not `\0'
  44.      but _*_*_e_n_d_p_t_r is `\0' on return, the entire string was valid.)
  45.  
  46. RREETTUURRNN VVAALLUUEESS
  47.      The ssttrrttoouull() function returns either the result of the conversion or, if
  48.      there was a leading minus sign, the negation of the result of the conver-
  49.      sion, unless the original (non-negated) value would overflow; in the lat-
  50.      ter case, ssttrrttoouull() returns ULONG_MAX and sets the global variable _e_r_r_n_o
  51.      to ERANGE.
  52.  
  53. EERRRROORRSS
  54.      [ERANGE]      The given string was out of range; the value converted has
  55.                    been clamped.
  56.  
  57. SSEEEE AALLSSOO
  58.      strtol(3)
  59.  
  60. SSTTAANNDDAARRDDSS
  61.      The ssttrrttoouull() function conforms to ANSI C3.159-1989 (``ANSI C'').
  62.  
  63. BBUUGGSS
  64.      Ignores the current locale.
  65.  
  66. BSD Experimental                 June 25, 1992                               1
  67.